﻿namespace xWF.Examples.Tkmv.Transitions
{
    /// <summary>
    /// Потребителем нажата кнопка «Удалить ТКМВ»
    /// </summary>
    class TkmvDeleteButton : TkmvButtonTransitions
    {
        public TkmvDeleteButton()
        {
            Title = "Удалить ТКМВ";
        }

        public override bool CanExecute(TkmvWorkItem workItem)
        {
            return workItem.CheckRole(UserRoleTkmv.Consumer);
        }

        protected override void OnExecute(TkmvWorkItem workItem)
        {
            //workItem.Service<TkmvSvc>().Delete(workItem.TkmvId);
            Redirect = @"/_layouts/Asteros.Sharepoint.MezhVed/ListTkmv.aspx"; 
        }
    }
}